package cn.tedu.oa.seal.controller;

import cn.tedu.oa.base.response.JsonResult;
import cn.tedu.oa.seal.pojo.dto.SealQuery;
import cn.tedu.oa.seal.pojo.dto.SealSaveParam;
import cn.tedu.oa.seal.pojo.vo.SealVO;
import cn.tedu.oa.seal.service.SealService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/oa1/seal")
@Slf4j

public class SealController {
    @Autowired
    SealService sealService;

    @GetMapping("/select")
    public JsonResult select(SealQuery sealQuery){
        log.debug("查询印章信息");
        List<SealVO> list = sealService.select(sealQuery);
        return JsonResult.ok(list);
    }
    @PostMapping("/save")
    public JsonResult save(SealSaveParam sealSaveParam){
        log.debug("新增印章信息"+sealSaveParam);
        sealService.save(sealSaveParam);
        return JsonResult.ok();
    }
    @PostMapping("/delete/{id}")
    public JsonResult delete(@PathVariable Integer id){
        log.debug("删除印章信息"+id);
        sealService.delete(id);
        return JsonResult.ok();
    }

}
